package com.yanqu.road.server.cmd.activity.recallplayer;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.RecallPlayerProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.GameProtocol;
import com.yanqu.road.utils.YanQuMessageUtils;
import io.netty.channel.ChannelHandlerContext;

@Cmd(code = CrossProtocol.C_PLAYER_RECALL_BIND_TASK_SYNC, desc = "同步回归玩家任务给活跃玩家")
public class BindPlayerSyncTaskCmd implements Command {
    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
        RecallPlayerProto.SyncBindTaskDataMsg syncBindTaskDataMsg = RecallPlayerProto.SyncBindTaskDataMsg.parseFrom(packet.getBytes());
        YanQuMessage message = YanQuMessageUtils.buildMessage(GameProtocol.S_RECALL_PLAYER_SYNC_BIND_TASK, syncBindTaskDataMsg);
        MessageHelper.sendPacket(syncBindTaskDataMsg.getSyncToServerId(), 0, message);
    }
}
